Search for text and replace with bolded text

It seems like by this time (using DOORS 9.5)  there should be an option in the Search and Replace to apply rich text options features ... but that being said ...I am not a DXL coder or a coder of any kind and I need to search for a specific word in the Object Text attribute and then bold that text. 

I have read the Jan 11 2012 "Finding a rich text phrase and replacing it with different rich text" topic and cannot figure out how to do this. 

Does anyone have a simple dxl script with simple instuctions for how to implement that that would assist me in performing this task?

Thank you


PatRoof - Sun Nov 17 09:27:06 EST 2013

Re: Search for text and replace with bolded text
pommCannelle - Mon Nov 18 04:07:06 EST 2013

Here after a simple example to do what you want ... Feel free to post your code if you are in trouble ;)

string bold(string s, string wordToBold){
    string buf = s
    string res = ""
    Regexp r = regexp wordToBold
    int index = 0
    while ( !null buf && r buf ){
        res = res buf[0:start(0)-1] "{\\b{" wordToBold "}}"
        buf = buf[start(0)+length(wordToBold):]
        index += start(0)+length(wordToBold)
    }
    res = res buf ""
    return res
}

Object o = current
o."object text" = richText bold ( o."object text""", "test" )

Best regards !